package com.example.demo.controller;

import com.example.demo.domain.vo.ProcessInstanceVo;
import com.example.demo.service.ChooseProcessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description:  选择型
 * @Author: zsg
 * @Date: 2018/07/10 16:20
 */
@RestController
@RequestMapping("/choose")
public class ChooseProcessController {

    @Autowired
    private ChooseProcessService chooseProcessService;

    /**
     * 开启一个流程
     * @param processKey
     * @param userId
     * @param message 选择的条件
     * @return
     */
    @GetMapping("startProcess")
    public List<ProcessInstanceVo> startProcess(@RequestParam("processKey") String processKey, @RequestParam("userId") String userId, @RequestParam("message") String message){
        List<ProcessInstanceVo> voList = this.chooseProcessService.startProcess(processKey, userId, message);
        return voList;
    }
}
